home *** CD-ROM | disk | FTP | other *** search
AMOS Source Code | 1996-01-26 | 2.5 KB | 68 lines |
- ' ********************************************************
- ' *** ***
- ' *** Zoom Procedure ***
- ' *** ***
- ' *** by ***
- ' *** ***
- ' *** Joseph Bolin ***
- ' *** ***
- ' ********************************************************
-
-
- Screen Open 0,320,200,16,Lowres
- Cls 0
- Flash Off
- For C=0 To 15
- Colour C,C*$100
- Next
- For Y=1 To 15
- For X=1 To 15
- C=(Point(X-1,Y)+Point(X,Y-1))/2+Rnd(2)
- If C>15 Then C=14
- Plot X,Y,C
- Next
- Next
- _ZOOM[2,0,0,0,16,16,0,64,0]
- _ZOOM[4,0,0,0,16,16,0,128,0]
- _ZOOM[8,0,0,0,16,16,0,64,72]
-
- Procedure _ZOOM[_POWER,_SOURCE,_XSTART,_YSTART,_XEND,_YEND,_DEST,_XDEST,_YDEST]
-
- ' Inputs: _POWER Zoom factor: 2, 4, or 8
- ' _SOURCE Screen to zoom from
- ' _XSTART Zoom start x pos (multiple of 16)
- ' _YSTART Zoom start y pos
- ' _XEND Zoom end x pos (+1) (Size must be multiple of 16)
- ' _YEND Zoom end y pos (+1)
- ' _DEST Screen to zoom to
- ' _XDEST Zoom destination x pos (multiple of 16)
- ' _YDEST Zoom destination y pos
- '
- ' Output: Zooms the source area to the destination area and expands it
- If _POWER<>2 and _POWER<>4 and _POWER<>8 Then Error 23
- If _XEND<_XSTART Then Swap _XSTART,_XEND
- If _YEND<_YSTART Then Swap _YSTART,_YEND
- _XSTART=_XSTART and 1008
- _XDEST=_XDEST and 1008
- If _XSTART<0 Then _XSTART=0
- If _YSTART<0 Then _YSTART=0
- If _XDEST<0 Then _XDEST=0
- If _YDEST<0 Then _YDEST=0
- _XSIZE=_XEND-_XSTART and 1016
- _YSIZE=_YEND-_YSTART
- If _POWER=2 or _POWER=4 Then _XSIZE=_XSIZE and 1008
- If _XSIZE=0 or _YSIZE=0 Then Error 23
- SC=Screen : Screen _SOURCE : SCB=Screen Base
- If _XSTART+_XSIZE>Screen Width Then _XSIZE=Screen Width-_XSTART
- If _XSIZE<0 Then Error 23
- If _YSTART+_YSIZE>Screen Height Then _YSIZE=Screen Height-_YSTART
- If _YSIZE<0 Then Error 23
- Screen DES
- If _XSTART+_XSIZE*_POWER>Screen Width Then Error 23
- If _YSTART+_YSIZE*_POWER>Screen Height Then Error 23
- _MLZOOM[_POWER,_XSTART,_YSTART,_XDEST,_YDEST,_XSIZE,_YSIZE,SCB,Screen Base]
- Screen SC
- End Proc
- Procedure _MLZOOM[POWER,XS,YS,XD,YD,XSZ,YSZ,SRCSCB,DESSDCB]
- ' COMPILED PROCEDURE -- can't convert this to AMOS code
- End Proc